package com.arpa.ntocc.common.domain.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Allen chen
 * @Date 2020/9/5
 * @Description:
 */
public enum CustomerCheckStatusEnum {

    /**
     * 客户审核枚举
     */
    NO_CHECK(0,"未审核"),
    SUCCESS_CHECK(1,"审核通过"),
    FAILED_CHECK(2,"审核未通过"),
    ;

    private final Integer code;

    private final String desc;

    CustomerCheckStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }


    public String getDesc() {
        return desc;
    }

    private static final Map<Integer,CustomerCheckStatusEnum> ENUM_MAP = new HashMap<>();

    static {
        CustomerCheckStatusEnum[] values = CustomerCheckStatusEnum.values();
        int length = values.length;
        for (int i=0;i<length;i++){
            CustomerCheckStatusEnum value = values[i];
            ENUM_MAP.put(value.getCode(),value);
        }
    }

    public static CustomerCheckStatusEnum getEnumByCode(Integer code){
        return ENUM_MAP.get(code);
    }

}
